{% extends "modal_form.html" %}
{% load inventree_extras %}
{% load i18n %}

{% block pre_form_content %}

{{ block.super }}

{% if matches %}
<div class='alert alert-block alert-warning'>
    <strong>{% trans "Possible Matching Parts" %}</strong>
    <p>{% trans "The new part may be a duplicate of these existing parts" %}:</p>
    <ul class='list-group'>
    {% for match in matches %}
    <li class='list-group-item list-group-item-condensed'>
        {% decimal match.ratio as match_per %}
        {% blocktrans with full_name=match.part.full_name desc=match.part.description %}{{full_name}} - <em>{{desc}}</em> ({{match_per}}% match){% endblocktrans %}
    </li>
    {% endfor %}
</ul>
</div>
{% endif %}

{% endblock %}
